<?php

namespace Biz\model\advertisement;


class MHhzPositionClose extends MBaseDbModel
{
    const _CONFIG_FILE_ = 'db_position';

    const _CONFIG_SELECT_ = 'db_position';

    const _DATABASE_ = 'hhz_position';

    const _TABLE_NAME = 'hhz_position_close';

    public static function add($id, $uid, $sign = '')
    {
        $data = [
            'config_id' => $id,
            'uid' => $uid,
            'sign' => $sign,
        ];
        $where = ['config_id' => $id, 'uid' => $uid];
        if (self::count($where)) {
            $data['times[+]'] = 1;
            self::update($data, $where);
        } else {
            $data['times'] = 1;
            $data['addtime'] = date("Y-m-d H:i:s");
            self::insert($data);
        }
    }
}

